package com.changgou.order.listener;

import com.changgou.order.config.RabbitMQConfig;
import com.changgou.order.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author kfzhao
 * @version 1.0
 * @className OrderTaskListener
 * @description
 * @date 2022/1/5 2:36
 */
@Component
@Slf4j
public class OrderTaskListener {

    @Autowired
    private OrderService orderService;
    @RabbitListener(queues = RabbitMQConfig.ORDER_TACK)
    public void receiveOrderTaskMessage(String message) {
      log.info("收到自动确认收货的信息");
      // 调用业务层
        orderService.autoTack();
    }
}
